package practise.mulitThreads.ConcurrentInPractice.Memorizer;

/**
 * Created by richard on 6/13/14.
 */
public class ComputeObject {
    private Visitor<ComputeObject> visitor;
    private Integer value ;
    public ComputeObject(Integer value){
        this.setValue(value);
    }


    public Integer compute(){
        return getVisitor().visit(this);
    }

    public Visitor<ComputeObject> getVisitor() {
        return visitor;
    }

    public void setVisitor(Visitor<ComputeObject> visitor) {
        this.visitor = visitor;
    }

    public Integer getValue() {
        return value;
    }

    public void setValue(Integer value) {
        this.value = value;
    }
}
